<%--
  Created by IntelliJ IDEA.
  User: 唐佳林
  Date: 2025/3/25
  Time: 15:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<html>
<head>
    <title>商城列表</title>
    <style>
        table, th, td {
            border: 1px solid black;
            border-collapse: collapse; /* 合并边框 */
        }
        th, td {
            padding: 8px; /* 单元格内边距 */
            text-align: center; /* 文本居中 */
        }
    </style>
</head>
<body>
<h1>Product List</h1>
<table >
    <form action="products" method="post">
        商品名称<input type="text"  name="pname" required><br>
        商品简介<input type="text"  name="pdesc" required><br>
        商品价格<input type="text"  name="pprice" required><br>
        <input type="submit" value="保存"><br>
    </form>
    <tr>
        <th>商品ID</th>
        <th>商品名称</th>
        <th>商品简介</th>
        <th>商品价格</th>
    </tr>
    <c:forEach var="product" items="${products}">
        <tr>
            <td>${product.id}</td>
            <td>${product.name}</td>
            <td>${product.description}</td>
            <td>${product.price}</td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
